package com.mcflies.aotoPartsManager.action;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.mcflies.aotoPartsManager.util.AutoPartsConstantKey;
import com.mcflies.aotoPartsManager.util.AutoPartsGUIDef;

import net.sf.json.JSONObject;

/**
 * 
 * AutoPartsCustomerAction.java
 * 
 * @describe：汽车配件管理系统--客户信息操作受理类
 * @Copyright(c) 2012-2024 Study,mcfly
 * @author mcfly_jun
 */
public class AutoPartsCustomerAction {
	private JSONObject resultObj = new JSONObject();
	private int start;
	private int limit;

	public String loadAllCustomer() {
		Map<String, Object> retMap = new HashMap<String, Object>();
		List<Object> rows = new ArrayList<Object>();
		int count = 43;
		int end = (start + limit) < count ? (start + limit) : count;
		for (int i = start; i < end; i++) {
			Map<String, Object> map = new HashMap<String, Object>();
			map.put(AutoPartsGUIDef.CustomerGuiDef.customerId, i);
			map.put(AutoPartsGUIDef.CustomerGuiDef.customerName, "客户名称[" + i + "]");
			map.put(AutoPartsGUIDef.CustomerGuiDef.customerShortName, "客户简称[" + i + "]");
			map.put(AutoPartsGUIDef.CustomerGuiDef.businessRelation, "业务关系[" + i + "]");
			map.put(AutoPartsGUIDef.CustomerGuiDef.customerArea, "所属区域[" + i + "]");
			map.put(AutoPartsGUIDef.CustomerGuiDef.customerPhone, "联系电话[" + i + "]");
			rows.add(map);
		}
		retMap.put(AutoPartsGUIDef.CommonGuiDef.results, count);
		retMap.put(AutoPartsGUIDef.CommonGuiDef.rows, rows);
		resultObj = JSONObject.fromObject(retMap);
		return AutoPartsConstantKey.RETURN_JSON_OBJECT_TYPE;
	}

	public int getStart() {
		return start;
	}

	public void setStart(int start) {
		this.start = start;
	}

	public int getLimit() {
		return limit;
	}

	public void setLimit(int limit) {
		this.limit = limit;
	}

	public JSONObject getResultObj() {
		return resultObj;
	}

	public void setResultObj(JSONObject resultObj) {
		this.resultObj = resultObj;
	}

}
